#ifndef DATASERVER_H
#define DATASERVER_H

#include <QObject>

#if defined( __WIN32__ ) || defined( WIN32 ) || defined( _WIN32 )
    #include <QTSql/QSqlDatabase>
    #include <QTSql/QSqlQuery>
#else
    #include <QSqlDatabase>
    #include <QSqlQuery>
#endif

#include <QThread>
#include <QMutexLocker>

class DataServer : public QObject
{
    Q_OBJECT
public:
    DataServer(QObject *parent = 0);
    quint32 GetAccID(QString name);
    QStringList GetFriends(int plid);
    QStringList GetBlocked(int plid);
    bool AddUser(QString username, QString password, QString salt);
    bool CheckLogin(quint32 userid, QString password);
    QString GetSalt(QString username);
    bool AddFriend(QString pid, QString fid);
    bool AddBlock(QString pid, QString bid);
    bool RemoveFriend(QString pid, QString fid);
    bool RemoveBlock(QString pid, QString bid);

signals:
    
public slots:
private:
    bool createConnection();
    QSqlDatabase db;

};

#endif // DATASERVER_H
